#!/bin/bash

# 启动微信公众号文章解析器MCP工具

echo "正在启动微信公众号文章解析器MCP工具..."

# 创建虚拟环境（如果不存在）
if [ ! -d "venv" ]; then
    echo "创建Python虚拟环境..."
    python3 -m venv venv
fi

# 激活虚拟环境
echo "激活虚拟环境..."
source venv/bin/activate

# 升级pip
echo "升级pip..."
pip install --upgrade pip

# 安装依赖
echo "安装项目依赖..."
pip install -r requirements.txt

# 安装Playwright浏览器
echo "安装Playwright浏览器..."
python -m playwright install chromium

# 启动服务
echo "启动MCP服务..."
echo "服务将在 http://0.0.0.0:8000 上运行"
echo "请访问 http://localhost:8000/docs 查看API文档"

python main.py